import axios from 'axios'

export default ({url, params, config}) => {
  let method = config && config.method || 'post'
  if (method === 'get') {
    return axios.get(url, { params })
  } else {
    return axios.post(url, params)
  }
}